﻿--#include "data\config\cross\CrossExpSceneConfig.lua" once   		--跨服经验场景

local npcId = 198
NpcDialog[npcId] = {}
local t = NpcDialog[npcId]

t.main = function(sysarg)
	local strCond 		= Lang.ScriptTips.CrossExp001
	local strDesc 		= Lang.ScriptTips.CrossExp002
	local okBtn 		= ""			--{按钮;样式;按钮名;函数名;描述}
	local strBtnList 	= ""
	okBtn1 		= "{btn;0;"..Lang.ScriptTips.ButtonEnter..";%s;}"				--{按钮;样式;按钮名;函数名;描述}
	strBtnList 	= string.format(okBtn1, "EnterCrossExpSceneFromNpc")

	--local localFun = string.format("OpenView,%s,%d", enLinkBuyItemWnd, cfg.itemId)
	--strBtnList = strBtnList .. string.format(cfg.buyBtn, localFun)

	-----------------
	local pack = DataPack.allocPacket(sysarg, LogicCmd.npcDialogSys.sysID, LogicCmd.npcDialogSys.sub.sNpcDlgData)
	
	DataPack.writeUint64(pack, Actor.getNpc(sysarg))
	DataPack.writeByte(pack, NpcDialogType.FYSDNpcDlg)
	DataPack.writeString(pack, strCond)
	DataPack.writeString(pack, strDesc)
	DataPack.writeString(pack, strBtnList)
	DataPack.writeChar(pack, -1)
	DataPack.writeByte(pack, 0);
	DataPack.flush(pack)

	return str
end


--进入副本
t.EnterCrossExpSceneFromNpc = function ( sysarg )
	if not Actor.IsCross( sysarg ) then
		Actor.sendTipmsg(sysarg, Lang.ScriptTips.COM0082,ttFlyTip)
		return
	end

	local myCircle = Actor.getIntProperty(sysarg,PROP_ACTOR_CIRCLE)
	local expSceneCfg = GetElemByCond( CrossExpSceneConfig, myCircle )
	if not expSceneCfg then
		return
	end

	CommonEnterScence( sysarg, expSceneCfg, GameLog.clEnterCrossExpSceneFee, "cross exp scene" )
end



